<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> 
<title></title>
<link type="text/css" rel="stylesheet" href="js/zepto.alert.css"/>
<link type="text/css" rel="stylesheet" href="js/selector.css"/>
<script type="text/javascript" src="js/zepto.min.js"></script>
<script type="text/javascript" src="js/zepto.alert.js"></script>
<script src="js/Selector.js"></script>
</head>
<style>
body{margin:0; padding:0; color:#000000; font-size:18px;font-family:"Microsoft YaHei",微软雅黑,"MicrosoftJhengHei",华文细黑,STHeiti,MingLiu;background-image:url(images/bg.jpg); background-size:100% 100%;}
.tblForm{width:220px;height:180px; text-align:center;}
.tblForm td{height:30px; line-height:30px; margin:auto; border-bottom:1px #4a4a4a solid; text-align:left; vertical-align:bottom;}
input {color:#000000;width:140px;height:25px;BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; FONT-SIZE: 18px; BACKGROUND: none transparent scroll repeat 0% 0%; BORDER-BOTTOM-WIDTH: 0px; TEXT-ALIGN: left; BORDER-RIGHT-WIDTH: 0px;margin-top: 1px;}
select{color:#000000;width:150px;height:25px;FONT-SIZE: 18px; TEXT-ALIGN: left;  margin-left:-4px;}
font{color:#ee9c01;}
</style>
<body>
<table width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr><td align="center" valign="top">
<form id="form" method="post" action="app.php?act=reg" target="iframeSubmit">
<table style="width:320px;height:522px; text-align:center;" cellpadding="0" cellspacing="0">
<tr><td height="10">&nbsp;</td></tr>
<tr><td height="100"><img src="images/top.png" width="320"/></td></tr>
<tr><td align="center"><table class="tblForm" cellpadding="0" cellspacing="0">
<tr><td height="45" width="70">姓名</td><td ><input type="text" name="dbname" id="name"/></td></tr>
<tr><td height="45" >手机号</td><td  ><input type="tel" name="dbphone" id="phone" maxlength="11"/></td></td></tr>
<tr><td height="45">组别</td>
<td style="position:relative;" >
<select name="dbmygroup" id="group">
<option>大切诺基组</option>
<option>自由光组</option>
</select>
 
</td>
</tr>
<tr><td height="45" >编号</td><td><input type="text" name="dbidnum" id="idnum"/></td></tr>
</table></td></tr>
<tr><td height="95px"><img src="images/go.png" onClick="reg();" width="73"/></td></tr>
<tr><td>&nbsp;</td></tr><input type="hidden" name="dbVisitSource" id="src"/>
<input type="hidden" name="dbsrc" id="src1"/>
</table>
</form>
</td></tr>
</table>
<iframe name="iframeSubmit" style="width:0px; height:0px;display:none;"></iframe>
<script>
function getQueryString(name) {
   var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i");
   var r = window.location.search.substr(1).match(reg);
   if (r!=null) return (r[2]); return null;
}
$(function(){
	 var url = window.location.href;
	 $("#src").val(url);
	 var a = getQueryString("src");
	 
	 //if(!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/))
	 //{
	//	 $(".m-select").css("top","-9px");
		// $("#group").css("background","none");
	// }
	 $("#src1").val(a);
 	//  new SelectorJS.selector.init({
    //    id:'#group',
    //    data: [["大切诺基组", "大切诺基组"], ["自由光组", "自由光组"]],
    //    value:'大切诺基组'
   //   }); 
	});
function showMsg(id,msg)
{
	if(id>0)
	{
		window.location.href="ques.html?uid="+id;
	}
	else
	{
		$.dialog({
                    content : msg,
                    title: "alert",
					width: 320,
					ok : function(){
            		 
            		return true;
        			}
                });
	}
}
function reg()
{
	var errMsg = "";
	var ValidPhone =new RegExp(/(^(13|15|18|14)(\d){9}$)|(^189\d{8}$)/);
	if($("#name").val()=="")
	{
		errMsg = "姓名不能为空";
	}
	if(!ValidPhone.test($("#phone").val())){
		errMsg = "手机号格式有误";
	}
	if($("#group").val()=="0")
	{
		errMsg = "组别不能为空";
	}
	if($("#idnum").val()=="")
	{
		errMsg = "编号不能为空";
	}
	//var idnum = $("#idnum").val();
	//if(idnum.length<6)
	//{
	//	errMsg = "编号必须为6位";
	//}
	if(errMsg!="")
	{
				$.dialog({
                    content : errMsg,
                    title: "alert",
					width: 320,
					ok : function(){
            		 
            		return true;
        			}
                });
		return;
	}
	document.getElementById("form").submit();
}
 
</script>
</body>
</html>